home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / prolog / sbprolog / amiga / builtin2.zoo / syscall.c < prev    next >
C/C++ Source or Header  |  1988-08-15  |  880b  |  43 lines

  1. /* 
  2. syscall.c by Davic Roch
  3. This routine translates some of the Berkely Unit (tm)
  4. system calls to the Amiga.
  5. */
  6.  
  7. #include <stdio.h>
  8. #include "syscall.h"
  9.  
  10. syscall(n, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
  11. int n;
  12. call_args    arg1, arg2, arg3, arg4, arg5, arg6, arg7;
  13. {
  14. char dummy[200];    
  15.  
  16.     switch (n) {
  17.  
  18.     case SYS_chdir:
  19.     dummy[0] = '\0';
  20.     strcpy(dummy,"cd ");
  21.     strcpy(dummy,arg1);
  22.     return(system(dummy));
  23.  
  24.     case SYS_chmod:
  25.     dummy[0] = '\0';
  26.     strcpy(dummy,"protect ");
  27.     strcpy(dummy,arg1);
  28.     strcpy(dummy," ");
  29.     strcpy(dummy,arg2);
  30.     return(system(dummy));
  31.  
  32.     case SYS_access:
  33.     return(access(arg1, arg2));
  34.     default: {
  35.         printf("System call %d has not yet been implemented in this port of SBProlog\n",n);
  36.         printf("If you wish to add this system primitive, you must add the porber case\n");
  37.         printf("statement ot the C source file syscall.c and recompile\n");
  38.         return(-1);
  39.         }
  40.     }
  41. }
  42.  
  43.